#include "WPILib.h"
#include "Robot2489.h"

//.6 is the expand time for the cylinder with the magnet on it

extern bool kicking;

/**
 * Constructor for this robot subclass.
 *
 * Creates an instance of a RobotDrive with left and right motors plugged
 * into PWM ports 1 and 2 on the first digital module. Why is
 * SpeedController &rearLeftMotor 3 and SpeedController &rearRightMotor 4?
 */
Robot2489::Robot2489()
{
	leftFrontMotorController = new Jaguar(LEFTFRONT);
	leftBackMotorController = new Jaguar(LEFTBACK);
	rightFrontMotorController = new Jaguar(RIGHTFRONT);
	rightBackMotorController = new Jaguar(RIGHTBACK);
	
	myRobot = new RobotDrive(leftFrontMotorController, leftBackMotorController,
			                 rightFrontMotorController, rightBackMotorController); // create robot drive base
//	ds = DriverStation::GetInstance();
	rightStick = new Joystick(2); // create the joysticks
	leftStick = new Joystick(1);
	manipStick = new Joystick(3);
	KarlKompressor = new Compressor(4, 1, 4, 1);
	solKickOut = new Solenoid(8, 1);
	solKickIn = new Solenoid(8, 2);
	solLatch = new Solenoid(8, 3);
	kickTimar = new Timer();
//	screen = DriverStationLCD::GetInstance();
//	dseio = &DriverStation::GetInstance()->GetEnhancedIO();
	GetWatchdog().SetExpiration(0.1);
}

/*
 * Destructor which probably isn't necessary but we'll include anyway to
 * appear professional. HEH :D
 */
Robot2489::~Robot2489()
{
	delete KarlKompressor;
	delete myRobot;
//	delete ds;
	delete rightStick;
	delete leftStick;
	delete solKickOut;
	delete solKickIn;
	delete solLatch;
	delete kickTimar;
//	delete screen;
}

START_ROBOT_CLASS( Robot2489);
